package cn.maxwell.controller;

import cn.maxwell.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 订单服务来调用
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Value("${server.port}")
    private Integer port;

    @GetMapping("/loadById/{id}")
    public User loadById(@PathVariable("id") Long id){
        User user = new User();
        user.setId(1L);
        user.setName("hehe!!!"+port);
        user.setSex(0);
        return user;
    }
}
